$(function(){

//drag dashboard
	var $report = $("#report"),
		$container = $("#container");
		
	$("li", $report).draggable({
		containment: "document",
		helper: "clone",
		cursor: "move"
	});	
	
	$container.droppable({
		accept: ":not(a.icon)",
		activeClass: "ui-state-highlight",
		drop:function(event, ui){
			dragReport(ui.draggable);	
		}
	});
	
	
	function dragReport($item){
			var $content = $("ul", $container).length ?
			$("ul", $container):
			$("<ul class='report ui-helper-reset'/>").appendTo($container);
			
			if($item.is(":contains('Report 1')")){
				$("<li><img src='../../../images/bp_odcs.JPG'/></li>").appendTo($content);
				$("li#icon1", $report).draggable({
					disabled: true					   
				});
			}
			if($item.is(":contains('Report 2')")){
				$("<li><img src='../../../images/bp_sbus.JPG'/></li>").appendTo($content);
				$("li#icon2", $report).draggable({
					disabled: true					   
				});
			}	
			$container.find(".ui-widget-header").remove();
		
	}
});	